<?php
require('common_view_functions.php');

$client_tz = $this->config->item('ClientTimeZone');

$title = $blog_info->title;
$link = base_url() . $blogger_uri;
$description = $blog_info->slogan;

$rss_content_prefix = '';
$rss_content_suffix = '';

function rss_datetime($datetime, $tz) {
	$dt = strtotime($datetime) - (int)($tz * 3600);
	return date('D, d M Y H:i:s', $dt) . ' GMT'; // Sat, 07 Sep 2002 00:00:01 GMT
}

echo('<?xml version="1.0" encoding="utf-8" ?>');
?>
<rss version="2.0">
	<channel>
		<title>Latest comments of <?php echo(htmlspec($title)); ?></title>
		<link><?php echo($link); ?></link>
		<description><?php echo(htmlspec($description)); ?></description>
		<managingEditor>member@blog.sinzy.net (<?php echo(htmlspec($blog_info->user_name)); ?>)</managingEditor>
		<language>zh-cn</language>
		<generator>nirvana Blog Application <?php echo($this->config->item('Version')); ?></generator>
		<?php
		foreach($recent_comments as $e) {
		?>
		<item>
			<title>By: <?php echo(htmlspec($e->author_name)); ?></title>
			<link><?php echo(base_url() . $blogger_uri . '/entry/' . $e->entry_id . '#c' . $e->id); ?></link>
			<description><?php echo(htmlspec($e->content)); ?></description>
			<pubDate><?php echo(rss_datetime($e->post_time, $client_tz)); ?></pubDate>
			<guid><?php echo(base_url() . $blogger_uri . '/entry/' . $e->entry_id . '#c' . $e->id); ?></guid>
		</item>
 		<?php
		}
		?>
	</channel>
</rss>